Skip to content

Prevent the intellifire client from polling independently of its coordinator#165341

Merged
joostlek merged 10 commits intohome-assistant:devfrom
jeeftor:feature/intellifire_double_poll_v2
Apr 9, 2026
Merged

Prevent the intellifire client from polling independently of its coordinator#165341
joostlek merged 10 commits intohome-assistant:devfrom
jeeftor:feature/intellifire_double_poll_v2

Conversation

@jeeftor
Copy link
Copy Markdown
Contributor

@jeeftor jeeftor commented Mar 11, 2026

Proposed change

In the current mode of operation Home Assistant issues a change request to the fireplace via the backing library, then waits until the next coordinator poll to pick up the new state. Meanwhile the backing library is also running its own internal polling loop, resulting in duplicate polls and slower responsiveness.

This PR fixes that by:

  • Passing polling_enabled=False when constructing the UnifiedFireplace, disabling the library's internal polling loop
  • Calling perform_poll() directly from the coordinator's _async_update_data(), so HA controls all polling

The required library changes (perform_poll() and polling_enabled flag) landed in intellifire4py==4.4.0, which was bumped in the preliminary PR #165356.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue:
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
  • New or updated dependencies have been added to requirements_all.txt.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@jeeftor jeeftor changed the title double polling BugFix: Intellifire - Double Polling Mar 11, 2026
@jeeftor jeeftor force-pushed the feature/intellifire_double_poll_v2 branch from 76fcaec to e6f8c22 Compare March 11, 2026 18:21
Comment thread tests/components/intellifire/test_init.py Outdated
Comment thread tests/components/intellifire/test_init.py Outdated
Comment thread tests/components/intellifire/test_init.py Outdated
zxdavb
zxdavb previously requested changes Mar 11, 2026
Copy link
Copy Markdown
Member

@zxdavb zxdavb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions for you.

Comment thread tests/components/intellifire/test_init.py Outdated
@zxdavb
Copy link
Copy Markdown
Member

zxdavb commented Mar 11, 2026

Could you have this as release note on the client repo, and link to that from here?

Summary of Changes to Backing Lib
Added optional background_polling flag to UnifiedFireplace constructor to disable the library's internal polling loop
Added a perform_poll / poll() method to UnifiedFireplace that delegates to the appropriate local or cloud API

@zxdavb zxdavb changed the title BugFix: Intellifire - Double Polling Prevent the intellifire client from polling independently of its coordinator Mar 11, 2026
@jeeftor jeeftor marked this pull request as ready for review March 11, 2026 20:29
Copilot AI review requested due to automatic review settings March 11, 2026 20:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the IntelliFire integration to rely on Home Assistant’s coordinator-driven polling rather than the intellifire4py client polling independently, improving responsiveness after state changes.

Changes:

  • Bump intellifire4py dependency from 4.3.1 to 4.4.0.
  • Disable library-side polling at fireplace construction time and trigger polling from the coordinator (perform_poll()).
  • Add/extend tests and mocks to validate coordinator-driven polling behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
homeassistant/components/intellifire/__init__.py Passes a flag to disable library polling when constructing the UnifiedFireplace.
homeassistant/components/intellifire/coordinator.py Calls fireplace.perform_poll() during coordinator refresh to explicitly drive polling.
homeassistant/components/intellifire/manifest.json Pins integration requirement to intellifire4py==4.4.0.
requirements_all.txt Updates global pin for intellifire4py to 4.4.0.
requirements_test_all.txt Updates test pin for intellifire4py to 4.4.0.
tests/components/intellifire/conftest.py Extends the fireplace mock to include perform_poll.
tests/components/intellifire/test_init.py Adds tests asserting coordinator-driven polling and polling-disabled construction.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread tests/components/intellifire/test_init.py Outdated
Comment thread homeassistant/components/intellifire/__init__.py
Comment thread tests/components/intellifire/test_init.py Outdated
Comment thread tests/components/intellifire/test_init.py
@zxdavb
Copy link
Copy Markdown
Member

zxdavb commented Mar 11, 2026

Please address Copilot's points- mark them/mine as resolved, and re-request review from me when you're ready.

Copy link
Copy Markdown
Contributor

@epenet epenet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the library bkmp be done in a preliminary PR?

@jeeftor jeeftor mentioned this pull request Mar 11, 2026
21 tasks
@jeeftor
Copy link
Copy Markdown
Contributor Author

jeeftor commented Mar 11, 2026

@epenet - > YES IT CAN!

(once merged I'll rebase this PR)
#165356

Copilot AI review requested due to automatic review settings March 12, 2026 14:20
@jeeftor jeeftor force-pushed the feature/intellifire_double_poll_v2 branch from 01fe66a to 2bfd2e8 Compare March 12, 2026 14:20
Copilot AI review requested due to automatic review settings April 1, 2026 12:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread tests/components/intellifire/test_init.py
@jeeftor jeeftor marked this pull request as ready for review April 1, 2026 12:55
Copilot AI review requested due to automatic review settings April 1, 2026 12:56
@home-assistant home-assistant Bot requested review from edenhaus and zxdavb April 1, 2026 12:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread tests/components/intellifire/test_init.py Outdated
@jeeftor jeeftor marked this pull request as draft April 1, 2026 15:28
@jeeftor jeeftor marked this pull request as ready for review April 1, 2026 15:36
Copilot AI review requested due to automatic review settings April 1, 2026 15:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@joostlek joostlek dismissed stale reviews from edenhaus and zxdavb April 9, 2026 21:22

Test seems to be good now

@joostlek joostlek added this to the 2026.4.2 milestone Apr 9, 2026
@joostlek joostlek merged commit 1e78666 into home-assistant:dev Apr 9, 2026
39 of 41 checks passed
frenck pushed a commit that referenced this pull request Apr 10, 2026
…dinator (#165341)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@frenck frenck mentioned this pull request Apr 10, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 11, 2026
@jeeftor jeeftor deleted the feature/intellifire_double_poll_v2 branch April 21, 2026 18:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants